import React, { Component } from 'react';
import {
	StyleSheet, Image, TouchableOpacity
} from "react-native";
import { GLOBAL } from '../../config/global';

const scale = GLOBAL.SCALE;

export class CommonHeaderLeft extends Component {
	render () {
		let { onPress, color, imgStyle, topTouchStyle, ifHiddenTitle } = this.props;
		return (
			<TouchableOpacity style={[styles.topTouch, { marginTop: ifHiddenTitle ? (GLOBAL.IS_IPHONEX ? 52 * scale : 10 * scale) : 0 }, topTouchStyle]} onPress={onPress} activeOpacity={0.5}>
				<Image source={require('../../imgs/global/backGray.png')} style={[styles.backIconStyle, { tintColor: color }, imgStyle]} />
			</TouchableOpacity>
		)
	}
}
const styles = StyleSheet.create({
	topTouch: {
		width: 40 * scale,
		// height: 40 * scale,
	},
	backIconStyle: {
		width: 20 * scale,
		resizeMode: 'contain',
		marginLeft: 10 * scale
	}
})